(function () {
    "use strict";

    function Point(xCoordinate, yCoordinate) {
        return {
            x: xCoordinate,
            y: yCoordinate
        };
    }

    function calculateDistanceBetweenTwoPoints(firstPoint, secondPoint) {
        return Math.sqrt((secondPoint.x - firstPoint.x) * (secondPoint.x - firstPoint.x) +
            (secondPoint.y - firstPoint.y) * (secondPoint.y - firstPoint.y));
    }

    function Line(firstPoint, secondPoint) {
        return {
            pointOne: firstPoint,
            pointTwo: secondPoint,
            length: calculateDistanceBetweenTwoPoints(firstPoint, secondPoint)
        };
    }

    function doThreeLinesFormTriangle(firstLine, secondLine, thirdLine) {
        return firstLine.length + secondLine.length > thirdLine.length &&
            firstLine.length + thirdLine.length > secondLine.length &&
            thirdLine.length + secondLine.length > firstLine.length;
    }

    var a = new Point(1, 2),
        b = new Point(3, 5),
        c = new Point(8, 13),
        ab = new Line(a, b),
        bc = new Line(b, c),
        ca = new Line(c, a);

    console.log(doThreeLinesFormTriangle(ab, bc, ca));
}());